def inbound_1():
  """Inbound call to AilAg2, abnormal release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  Ext1AilAg1.ReleaseCall()

def inbound_2():
  """Inbound call to ACD2,  release AilAg2"""
  Ext1AilAg1.MakeCall(ACD2)
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()

def inbound_3():
  """Inbound call to ACD2,  abnormal release Ext1AilAg1"""
  AilAg2.SetNotReady()
  Ext1AilAg1.MakeCall(ACD2)
  Ext1AilAg1.ReleaseCall()
  AilAg2.SetReady()

def inbound_4():
  """Inbound call to ACD2 agent NotReady Ready"""
  AilAg2.SetNotReady()
  Ext1AilAg1.MakeCall(ACD2)
  AilAg2.SetReady()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()

def inbound_5():
  """Inbound call to ACD3 agent NotReady Ready"""
  AilAg3.SetNotReady()
  Ext1AilAg1.MakeCall(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()



def inbound_6():
  """Inbound to  AilAg2, two step transfer to AilAg3, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()
  
def inbound_7():
  """Inbound to  AilAg2, AilAg2 init transfer to AilAg3, release AilAg1, release AilAg2"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  Ext1AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()
  
def inbound_8():
  """Inbound to  AilAg2, AilAg2 init transfer to AilAg3, release AilAg1, AilAg3 answer, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  Ext1AilAg1.ReleaseCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()  
  
def inbound_9():
  """Inbound to  AilAg2, AilAg1 init transfer to AilAg3, release AilAg2, AilAg3 answer, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  Ext1AilAg1.InitiateTransfer(DN3)
  AilAg2.ReleaseCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()   

  
def inbound_12():
  """Inbound call to  DN2, two step transfer to AilAg3, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()

def inbound_13():
  """Inbound call to  DN2, two step transfer to AilAg3, abnormal release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

def inbound_14():
  """Inbound call to AilAg2, two step transfer to AilAg3, completed before consulted party answer"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.CompleteTransfer()
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()

def inbound_15():
  """Inbound call, two step transfer to AilAg3, completed before consulted party answer, abnor"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.CompleteTransfer()
  Ext1AilAg1.ReleaseCall()

def inbound_16():
  """Inbound call to  DN2,  AilAg2 two step transfer to ACD3, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()

def inbound_17():
  """Inbound call to  DN2, two step transfer to ACD3, agent NotReady-Ready, release AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()

def inbound_18():
  """Inbound call to AilAg2, two step transfer to ACD3, completed before consulted party answer"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()

def inbound_18a():
  """Inbound call Ext1DN1-DN2, two step transfer to ACD3, completed before consulted party answer """
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()


def inbound_19():
  """Inbound call Ext1DN1-DN2, two step transfer to ACD3, completed before consulted party answer, abnor """
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  Ext1AilAg1.ReleaseCall()
  AilAg3.SetReady()


def inbound_20():
  """something"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()
  AilAg2.InitiateTransfer(Ext1DN1)
  AilAg2.CompleteTransfer()
  Ext1AilAg1.AnswerCall()
  AilAg3.ReleaseCall()

def inbound_21():
  """Inbound call to AilAg2, inbound conference to AilAg3, release Ext1DN1, AilAg2"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  Ext1AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def inbound_22():
  """Inbound call to AilAg2, AilAg2 cinit conference to AilAg3, abnorl release AilAg2, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

def inbound_23():
  """Inbound call to AilAg2, inbound conference to ACD3, release Ext1DN1, AilAg2"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  Ext1AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def inbound_24():
  """Inbound call to AilAg2, AilAg2 init conference to ACD3, abnormal release AilAg2, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg2.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

def inbound_25():
  """Inbound call to AilAg2, inbound conference to ACD3, agent NotReady-Ready"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateConference(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  Ext1AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def inbound_26():
  """Inbound call to AilAg2, AilAg2 conference to AilAg3, completed before consulted party answer"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.CompleteConference()
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def inbound_27():
  """Inbound call to AilAg2, AilAg2 conf to AilAg3, compl before cons. party answer, abnor. release AilAg2"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.CompleteConference()
  AilAg2.ReleaseCall()
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()

def inbound_28():
  """Inbound call to AilAg3, AilAg3 conference to ACD2, completed before cons. party answer"""
  Ext1AilAg1.MakeCall(DN3)
  AilAg3.AnswerCall()
  AilAg3.InitiateConference(ACD2)
  AilAg3.CompleteConference()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

def inbound_29():
  """As above, but Agent NR-R"""
  Ext1AilAg1.MakeCall(DN3)
  AilAg3.AnswerCall()
  AilAg2.SetNotReady()
  AilAg3.InitiateConference(ACD2)
  AilAg2.SetReady()
  AilAg3.CompleteConference()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

def inbound_30():
  """Inbound call to AilAg2, mute transfer to AilAg3, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(DN3)
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()

def inbound_31():
  """Inbound call to AilAg2, mute transfer to ACD3, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(ACD3)
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()

def inbound_32():
  """Inbound call to AilAg2, mute transfer to ACD3, agent NotReady-Ready, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.MuteTransfer(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  Ext1AilAg1.ReleaseCall()

def inbound_33():
  """Inbound call to AilAg2, mute transfer to AilAg3, abnormal release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(DN3)
  Ext1AilAg1.ReleaseCall()

def inbound_34():
  """Inbound call to AilAg2, mute transfer to ACD3, agent NotReady-Ready, abnormal release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.MuteTransfer(ACD3)
  Ext1AilAg1.ReleaseCall()
  AilAg3.SetReady()
  
def inbound_35():
  """Inbound call to ACD2, AilAg2 answer, AilAg2 mute transfer to ACD2, release Ext1AilAg1"""
  Ext1AilAg1.MakeCall(ACD2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(ACD2)
  Ext1AilAg1.ReleaseCall()
  

def inbound_36():
  """Inbound call to AilAg2, conference, AilAg2drops AilAg3, release AilAg2"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg2.DeleteFromConference(DN3)
  AilAg2.ReleaseCall()
  

  
  
def inbound_37():
  """Inbound call to AilAg2, AilAg2 answer, AilAg2  SSC to AilAg3"""
  Ext1AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.SingleStepConference(DN3)
  AilAg3.ReleaseCall()
  Ext1AilAg1.ReleaseCall()

